//Pull data for panel of firms
odbc load, exec("select LopNr_PeOrgNr,  Org_BelKommun, Org_Sni2007, Org_Sni2007G,  Ftg_Foradlingsvarde, Ftg_Nettoomsattning, Ftg_Omsattningstillgangar, Ftg_Anlaggningstillgangar, Ftg_Eget_kapital,  Ftg_Summa_bruttoinv, Org_SektorKod from dbo.LISA2014_Ftg") dsn("[Project]") clear
duplicates drop LopNr_PeOrgNr, force
gen year=2014
destring, replace
save "[Folder]\Panel_Firm.dta", replace
clear all

forvalues i=2008/2013 {
odbc load, exec("select LopNr_PeOrgNr,  Org_BelKommun, Org_Sni2007, Org_Sni2007G,  Ftg_Foradlingsvarde, Ftg_Nettoomsattning, Ftg_Omsattningstillgangar, Ftg_Anlaggningstillgangar, Ftg_Eget_kapital,  Ftg_Summa_bruttoinv, Org_SektorKod   from dbo.LISA`i'_Ftg") dsn("[Project]") clear

duplicates drop LopNr_PeOrgNr, force
destring, replace
gen year=`i'
append  using "[Folder]\Panel_Firm.dta"
save "[Folder]\Panel_Firm.dta", replace

}
